package com.situ.mallbrand.service;

import com.mall.common.util.JsonResult;
import com.mall.model.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
import java.util.Map;

@FeignClient(value = "mall-gateway",contextId = "order-feign")
public interface ProductFeignClient {

    /**
     * 根据品牌ID获取商品列表
     */
    @GetMapping("/api/products/brand/{brandId}")
    List<Product> getProductsByBrand(@PathVariable("brandId") Long brandId);

    /**
     * 根据分类ID获取商品列表
     */
    @GetMapping("/api/products/category/{categoryId}")
    JsonResult<List<Map<String, Object>>> getProductsByCategory(@PathVariable("categoryId") Long categoryId);

    /**
     * 获取商品详情
     */
    @GetMapping("/api/products/{productId}")
    JsonResult<Map<String, Object>> getProductDetail(@PathVariable("productId") Long productId);

    /**
     * 获取热门商品
     */
    @GetMapping("/api/products/hot")
    JsonResult<List<Map<String, Object>>> getHotProducts();
}
